/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.sql.Date;
import java.util.Calendar;

/**
 *
 * @author theworldiwant
 */
public class User {
    private int id;
    private String username;
    private String password;
    private int userTypeId;
    private boolean actOrPass;
    private String profilePic;
    private int age;
    private char gender;
    private String location;
    private Date bday;
    private String shippingAddress;
    private String paymentOptions;

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @param username the username to set
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the userTypeId
     */
    public int getUserTypeId() {
        return userTypeId;
    }

    /**
     * @param userTypeId the userTypeId to set
     */
    public void setUserTypeId(int userTypeId) {
        this.userTypeId = userTypeId;
    }

    /**
     * @return the profilePic
     */
    public String getProfilePic() {
        return profilePic;
    }

    /**
     * @param profilePic the profilePic to set
     */
    public void setProfilePic(String profilePic) {
        this.profilePic = profilePic;
    }

    /**
     * @return the age
     */
    public int getAge() {
        
        return age;
    }

    /**
     * @param age the age to set
     */
    public void setAge(Date m) {
        java.util.Date d = new java.util.Date();
        
        int age=d.getYear()-m.getYear();
        if(d.getMonth()<m.getMonth())
            age--;
        
        this.age = age;
    }

    /**
     * @return the gender
     */
    public char getGender() {
        return gender;
    }

    /**
     * @param gender the gender to set
     */
    public void setGender(char gender) {
        this.gender = gender;
    }

    /**
     * @return the location
     */
    public String getLocation() {
        return location;
    }

    /**
     * @param location the location to set
     */
    public void setLocation(String location) {
        this.location = location;
    }

    /**
     * @return the bday
     */
    public Date getBday() {
        return bday;
    }

    /**
     * @param bday the bday to set
     */
    public void setBday(Date bday) {
        this.setAge(bday);
        this.bday = bday;
    }

    /**
     * @return the shoppingAddress
     */
    public String getShoppingAddress() {
        return shippingAddress;
    }

    /**
     * @param shoppingAddress the shoppingAddress to set
     */
    public void setShoppingAddress(String shoppingAddress) {
        this.shippingAddress = shoppingAddress;
    }

    /**
     * @return the actOrPass
     */
    public String getActOrPass() {
        if(actOrPass)
            return "active";
        else
            return "passive";
    }

    /**
     * @param actOrPass the actOrPass to set
     */
    public void setActOrPass(String a) {
        if(a.equalsIgnoreCase("active"))
            this.actOrPass = true;
        else
            this.actOrPass = false;
    }

    /**
     * @return the paymentOptions
     */
    public String getPaymentOptions() {
        return paymentOptions;
    }

    /**
     * @param paymentOptions the paymentOptions to set
     */
    public void setPaymentOptions(String paymentOptions) {
        this.paymentOptions = paymentOptions;
    }
    
}
